print("%s is number %d!" % ('python', 34))

# 把内容写到文件中
logfile = open('huhx.txt', 'a')
print('Fatal error: invalid input', file=logfile)
logfile.close()

content = input("please input:")
print(content)

# **表示乘方, /表示传统除法，//表示除法对结果四舍五入, %表示余数
print(3 ** 2, 5 / 3, 5 // 3, 5 % 3, sep=" ")  # 9 1.6666666666666667 1 2

print(3 < 4 and 4 < 5, 3 < 4 < 5, sep=" ") # True True


num = 45
num += 55
print(num, --num, ++num, sep=" ") # num++写法会报错，打印结果：100 100 100

name = "huhx"
print(name * 2, name + "linux") # huhxhuhx huhxlinux
# print("huhx" + 1) # TypeError: must be str, not int


print(ord('中'), chr(25991)) # 20013 文

# b'\xe4\xb8\xad\xe6\x96\x87' 中文
print('中文'.encode('utf-8'), b'\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8'))
print(len('中文'), len('中文'.encode('utf-8'))) # 2 6


def foo():
    "this is a doc string"
    return True
